Skip to content

Added Stochastic Variability in Community Detection Algorithms #820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from

Conversation

SKG24
Copy link

@SKG24 SKG24 commented Mar 26, 2025

Used Chatgpt for understanding the functions and theory around the mathematical process.

  • By submitting this pull request, I assign the copyright of my contribution to The igraph development team.

At first run:
Screenshot 2025-03-26 at 9 25 41 PM

At second run:
Screenshot 2025-03-26 at 9 27 55 PM

This supports stochastic method might give wildly different answers on a network without any significant community structure, while it gives consistent answers on one that has obvious communities.

Since the number of iterations is set to 50, even in structured graphs, slight variations in similarity scores may be observed.

SKG24 added 2 commits March 26, 2025 21:17
This example demonstrates the variability of stochastic community detection methods by analyzing the consistency of multiple partitions using similarity measures (NMI, VI, RI) on both random and structured graphs.
@szhorvat
Copy link
Member

I won't have time to look in detail today, but I checked whether the docs build with this change, and unfortunately they do not. Can you please check if you can fix this? You can build the docs using scripts/mkdoc.sh -c.

@szhorvat szhorvat marked this pull request as draft March 26, 2025 20:53
@SKG24
Copy link
Author

SKG24 commented Mar 27, 2025

Screenshot 2025-03-27 at 9 56 39 AM

Issue Description:
The script mkdoc.sh -c fails with the following error:

AttributeError: module 'igraph' has no attribute '_igraph'. Did you mean: 'Graph'?
This issue is persistent even after:

  • Reinstalling python-igraph
  • Passing clustering objects instead of membership lists in compare_communities()
  • Ensuring the same code works in Google Colab

@ntamas
Copy link
Member

ntamas commented Mar 27, 2025

I think I've fixed the build issue in the main branch; please try again and let me know if it still doesn't work.

@SKG24
Copy link
Author

SKG24 commented Mar 27, 2025

Thank you! It worked.

Screen.Recording.2025-03-27.at.9.33.28.PM.mov

Copy link
Member

@szhorvat szhorvat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice illustration!

I left a few comments for improvement.

Please remove changes to the sg_execution_times.rst file. This file was likely committed by accident, and I think we should remove it (but not as part of this PR).

I have made the changes as per the review.
@SKG24
Copy link
Author

SKG24 commented Mar 28, 2025

I have made the suggested changes.

Screen.Recording.2025-03-28.at.3.38.52.PM.mov

@SKG24
Copy link
Author

SKG24 commented Apr 1, 2025

This is a nice illustration!

I left a few comments for improvement.

Please remove changes to the sg_execution_times.rst file. This file was likely committed by accident, and I think we should remove it (but not as part of this PR).

Should I directly delete this file from PR through files changed section?

@szhorvat
Copy link
Member

szhorvat commented Apr 1, 2025

Should I directly delete this file from PR through files changed section?

Yes, that would be fine.

@SKG24 SKG24 requested a review from szhorvat April 6, 2025 18:29
@SKG24 SKG24 closed this May 8, 2025
@szhorvat szhorvat reopened this May 8, 2025
Copy link

stale bot commented Jul 20, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 20, 2025
@szhorvat
Copy link
Member

Continued in #840. I can't push to this as the work was done on the main branch instead of a separate branch.

@szhorvat szhorvat closed this Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants